Skip to content

[libvirt_manager] Add predictable network interface names to EDPM#3891

Open
holser wants to merge 1 commit into
openstack-k8s-operators:mainfrom
holser:feat_pnin
Open

[libvirt_manager] Add predictable network interface names to EDPM#3891
holser wants to merge 1 commit into
openstack-k8s-operators:mainfrom
holser:feat_pnin

Conversation

@holser
Copy link
Copy Markdown
Contributor

@holser holser commented Apr 24, 2026

Enable systemd predictable network interface naming inside guest VMs
by removing net.ifnames=0 from kernel args via virt-customize. This
gives guests consistent PCI-topology-based names (enp1s0, enp2s0, etc.)
instead of legacy ethN naming. Predictable network interfaces are
requirement for testing Leapp upgrade functionality.

Controlled by cifmw_libvirt_manager_predictable_nic_names (defaults
to false).

Jira: OSPRH-29381

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 24, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tosky for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@evallesp
Copy link
Copy Markdown
Contributor

LGTM, asked for a TP.

@danpawlik danpawlik requested a review from a team April 28, 2026 06:05
{{
(vm_item | default(_clean_vm)) | replace('-', '')
}}
_target_dev: >-
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(praise) Great improvement adding --target for predictable NIC naming.
(Question) : _target_dev is currently computed as (_vm_short ~ 'p' ~ (net_idx|int))[:15]. Because this relies on truncation to satisfy the 15‑char limit, there’s a chance of collisions for VMs with similar prefixes. Just another thing to mention, once net_idx goes to 2+ digits (p9 → p10), the suffix length changes and the truncation point shifts, which increases the chance of two different inputs collapsing to the same 15‑char string.

Would you be up for considering a slightly more collision‑resistant naming scheme that still stays within 15 characters (for example a fixed layout like <vm_prefix><short_hash_of _clean_vm>, using only letters and numbers)? Alternatively, a small guard/assert to catch duplicate targets early could also work nicely.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed this part as it requires unique naming for all interfaces. PR update relies on virt-customize only and VM OS ability to set up networking interfaces based on pci lanes

@centosinfra-prod-github-app
Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/3f0056fc5ff24f52859aae04918357d6

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 19m 14s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 22m 38s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 25m 34s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 06m 39s
✔️ cifmw-pod-zuul-files SUCCESS in 5m 35s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 13s
cifmw-pod-pre-commit FAILURE in 8m 41s
✔️ cifmw-molecule-libvirt_manager SUCCESS in 46m 11s
✔️ cifmw-molecule-reproducer SUCCESS in 14m 21s

Enable systemd predictable network interface naming inside guest VMs
by removing net.ifnames=0 from kernel args via virt-customize. This
gives guests consistent PCI-topology-based names (enp1s0, enp2s0, etc.)
instead of legacy ethN naming. Predictable network interfaces are
requirement for testing Leapp upgrade functionality.

Controlled by cifmw_libvirt_manager_predictable_nic_names (defaults
to false).

Jira: OSPRH-29381

Co-Authored-By: Lukas Bezdicka <lbezdick@redhat.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Sergii Golovatiuk <sgolovat@redhat.com>
@nemarjan
Copy link
Copy Markdown
Contributor

nemarjan commented May 6, 2026

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label May 6, 2026
@holser holser changed the title [libvirt_manager] Add predictable network interface names via --target [libvirt_manager] Add predictable network interface names to EDPM May 8, 2026
@nemarjan nemarjan requested a review from Valkyrie00 May 8, 2026 13:58
@michburk
Copy link
Copy Markdown
Contributor

Changes lgtm, especially seeing that they are opt-in, but @holser do you have a testproject that uses these changes that you could link in the comments of that jira story? I see Enrique requested one here and in the jira comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants